<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title></title>
        
    </head>
    <body>
        <div id="test">
            <p>abc</p>
            <p>def</p>
        </div>
        <a href="#" name='link'>aaa</a>
        <ul>
            <li>1</li>
            <li>2</li>
            <li>3</li>
        </ul>
        <div class="test2">test2-1</div>
        <div class="test2">test2-2</div>
    </body>
    <script>
        var test = document.getElementById("test")
        console.log(test)
        var link = document.getElementsByName("link")
        console.log(link)
        console.log(link[0])
        var li = document.getElementsByTagName("li")
        console.log(li)
        console.log(li[0])
        var test2 = document.getElementsByClassName('test2')
        console.log(test2)
        console.log(test2[0])
    </script>
</html>